import React from 'react';

import * as InformationStyle from './Information.less';

const innerStyle = {
	top: -50,
};

export default class Information extends React.Component {

	static propTypes = {
		label: React.PropTypes.string.isRequired,
		top: React.PropTypes.number,
		duration: React.PropTypes.number,
		animate: React.PropTypes.bool,
		icon: React.PropTypes.string,
		isOpen: React.PropTypes.bool
	};

	static defaultProps = {
		top: 120,
		duration: 8,
		animate: false,
		icon: "",
		isOpen: false
	};

	constructor(props) {
		super(props);
	}

	handleClose = () => {
		let { requestClose } = this.props;
		requestClose && requestClose();
	}

	render() {
		let { top, isOpen, icon, label } = this.props;

		let newStyle = null;
		if (isOpen) 
			newStyle = Object.assign({}, innerStyle, { top });
		else
			newStyle = innerStyle;

		return (
			<div className={InformationStyle.informationBar} style={newStyle}>
				{/*<img src={icon} />*/}
				<div>
					{label}
				</div>
			</div>
		);
	}
}